<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"> 
    <h:head></h:head> 
    <body> 
        <p:layout fullPage="true">  
  
        <p:layoutUnit position="north" size="120" style =" text-align : center;"  > 
         <h:inputHidden  value="#{customerPackageManagement.update()}"/>
	
    		<style type="text/css">
        	.ui-widget{font-size:90% !important;}  
      		</style> 
      	<a href="http://localhost:8080/TravelDreamFelConRusWeb/customer/customerhome.xhtml">
         <p:graphicImage  value="logo.jpg" style=" height:100px;" />
         </a>
		</p:layoutUnit>  
      
    
       <p:layoutUnit position="west" size="200" header="Pagine utili" resizable="false" closable="false" collapsible="false">   
            <p:menu>  
               
                       <p:menuitem value="Pacchetti" url="http://localhost:8080/TravelDreamFelConRusWeb/customer/packageManagement.xhtml" />  
                     <p:menuitem value="Promozioni" url="http://localhost:8080/TravelDreamFelConRusWeb/customer/promotions.xhtml" />  
                     <p:menuitem value="Pagina personale" url="http://localhost:8080/TravelDreamFelConRusWeb/customer/customerPersonal.xhtml" />  
        	 
            </p:menu>   
        </p:layoutUnit>  
      
       
      
      <p:layoutUnit position="center">  
	  <h:form id="form">
	   
    
 <p:dataTable var="travelPackage" value="#{customerPackageManagement.packageModel}" rowKey="#{travelPackage.idtravelpackage}" paginator="true" rows="10"  
                selection="#{customerPackageManagement.selectedTravelPackage}" filteredValue="#{customerPackageManagement.filteredTravelPackages}" selectionMode="single" 
               id="traveltable"
                 rowsPerPageTemplate="10,15,50">  
     <p:ajax event="rowSelect"  listener= "#{customerPackageManagement.updateCurrentPackage}"/>  
  

  
                <f:facet name="header">
                    Pacchetti
                </f:facet>  
                
                 <p:column  headerText="Nome" filterBy="#{travelPackage.name}" sortBy="#{travelPackage.name}"  id="name">
                    
                    
                 #{travelPackage.name}  
        		</p:column>  
        		<p:column  headerText="Descrizione"  filterBy="#{travelPackage.description}" sortBy="#{travelPackage.description}"  id="description">
                    
                    
                 #{travelPackage.description}  
        		</p:column> 
        		 <p:column  headerText="Data Inizio"  filterBy="#{travelPackage.time_start}" sortBy="#{travelPackage.time_start}"  id="timeStart">  
                 #{travelPackage.time_start}  
                 </p:column> 
                 <p:column  headerText="Data Fine"  filterBy="#{travelPackage.time_end}" sortBy="#{travelPackage.time_end}"  id="timeEnd">  
                 #{travelPackage.time_end}  
                 </p:column> 
               
               <f:facet name="footer">
                    <p:commandButton action="#{customerPackageEdit.show()}" value="Visualizza" icon="ui-icon-cart" />  
               		
               		<p:commandButton action="#{customerPackageEdit.allowed}" value="Personalizza" icon="ui-icon-star"  />  
               	
                    
                  
               </f:facet>
				
              </p:dataTable>
         </h:form>   
         
       
    
    
        </p:layoutUnit>  
      
        </p:layout>  
    
                         
             
         
      
<p:growl id="growl" showDetail="true" life="5000" />
         

 
        
    </body> 
    
    
</html>